package com.chance.cc.crawler.prod.command.trigger.domain.news.sina;

import com.chance.cc.crawler.core.CrawlerJob;
import com.chance.cc.crawler.core.downloader.HttpPage;
import com.chance.cc.crawler.meta.core.bean.CrawlerMetaConstant;
import com.chance.cc.crawler.prod.command.job.domain.news.sina.module.SinaCarSeriesArticleCrawlerScheduleJob;
import com.chance.cc.crawler.prod.command.job.domain.news.sina.module.SinaCarSeriesCrawlerScheduleJob;
import com.chance.cc.crawler.prod.command.job.domain.news.sina.module.SinaCarSeriesInformationCrawlerScheduleJob;
import com.chance.cc.crawler.prod.command.job.domain.news.sina.searchKw.SinaCarSeriesCommentCrawlerScheduleJob;
import com.chance.cc.crawler.prod.command.trigger.CommonCrawlerSchedulerTrigger;

/**
 * @author bx
 * @date 2020/12/7 0007 11:15
 */
public class SinaCarSeriesScheduleTrigger extends CommonCrawlerSchedulerTrigger {

    public static void main(String[] args) {//运行工作爬虫
//        publishCarSeriesArticleRealtimeScheduleTriggerInfo(SinaCarSeriesArticleCrawlerScheduleJob.publishSinaCarSeriesArticleCrawlerScheduleJobInfo());
        publishCarSeriesCommentRealtimeScheduleTriggerInfo(SinaCarSeriesCommentCrawlerScheduleJob.publishSinaCarSeriesCommentCrawlerScheduleJobInfo());

//        publishCarSeriesVideoRealtimeScheduleTriggerInfo(SinaCarSeriesVideoCrawlerScheduleJob.publishSinaCarSeriesArticleCrawlerScheduleJobInfo());
//        publishCarSeriesVideoCommentRealtimeScheduleTriggerInfo(SinaCarSeriesVideoCommentCrawlerScheduleJob.publishSinaCarSeriesCommentCrawlerScheduleJobInfo());

//        publishCarSeriesInformationRealtimeScheduleTriggerInfo(SinaCarSeriesInformationCrawlerScheduleJob.publishSinaCarSeriesArticleCrawlerScheduleJobInfo());
//        publishCarSeriesInformationCommentRealtimeScheduleTriggerInfo(SinaCarSeriesInformationCommentCrawlerScheduleJob.publishSinaCarSeriesCommentCrawlerScheduleJobInfo());

//        publishCarSeriesSimpleRealtimeScheduleTriggerInfo(SinaCarSeriesInformationSimpleCrawlerSchedulerJob.crawlerScheduler());

//        publishCarSeriesScheduleTriggerInfo(SinaCarSeriesCrawlerScheduleJob.publishCrawlerScheduleJobInfo());

    }

    //车系文章链接
    public static void publishCarSeriesArticleRealtimeScheduleTriggerInfo(CrawlerJob crawlerJob){//实时调度触发信息
        HttpPage page = metaServiceCommand_17.addOrUpdateScheduleCrawlerTrigger(//添加调度爬虫触发
                crawlerJob.generateCrawlerKey(),//生成爬虫key
                crawlerJob.generateCrawlerTriggerKey(),//生成爬虫触发key
                SinaCarSeriesArticleCrawlerScheduleJob.domain,//工作的域
                CrawlerMetaConstant.ScheduleJobTrigger_Cron, "0 0 17 * * ?", "新浪车系页文章链接每天17点定时采集");//采集信息-
        System.out.println("添加采集调度： "+page.getRawText());//调度文本
    }
    //车系文章评论
    public static void publishCarSeriesCommentRealtimeScheduleTriggerInfo(CrawlerJob crawlerJob){//实时调度触发信息
        HttpPage page = metaServiceCommand_17.addOrUpdateScheduleCrawlerTrigger(//添加调度爬虫触发
                crawlerJob.generateCrawlerKey(),//生成爬虫key
                crawlerJob.generateCrawlerTriggerKey(),//生成爬虫触发key
                SinaCarSeriesArticleCrawlerScheduleJob.domain,//工作的域
                CrawlerMetaConstant.ScheduleJobTrigger_Cron, "0 0 18 * * ?", "新浪车系页文章评论每天18点定时采集");//采集信息-
        System.out.println("添加采集调度： "+page.getRawText());//调度文本
    }

    //车系临时采集
    public static void publishCarSeriesSimpleRealtimeScheduleTriggerInfo(CrawlerJob crawlerJob){//实时调度触发信息
        HttpPage page = metaServiceCommand_17.addOrUpdateScheduleCrawlerTrigger(//添加调度爬虫触发
                crawlerJob.generateCrawlerKey(),//生成爬虫key
                crawlerJob.generateCrawlerTriggerKey(),//生成爬虫触发key
                SinaCarSeriesArticleCrawlerScheduleJob.domain,//工作的域
                CrawlerMetaConstant.ScheduleJobTrigger_Simple, "0 0 5 * * ?", "新浪车系页临时采集");//采集信息-
        System.out.println("添加采集调度： "+page.getRawText());//调度文本
    }


    //车系文章链接
    public static void publishCarSeriesVideoRealtimeScheduleTriggerInfo(CrawlerJob crawlerJob){//实时调度触发信息
        HttpPage page = metaServiceCommand_17.addOrUpdateScheduleCrawlerTrigger(//添加调度爬虫触发
                crawlerJob.generateCrawlerKey(),//生成爬虫key
                crawlerJob.generateCrawlerTriggerKey(),//生成爬虫触发key
                SinaCarSeriesArticleCrawlerScheduleJob.domain,//工作的域
                CrawlerMetaConstant.ScheduleJobTrigger_Cron, "0 0 9 * * ?", "新浪车系页视频链接每天9点定时采集");//采集信息-
        System.out.println("添加采集调度： "+page.getRawText());//调度文本
    }

    //车系文章评论
    public static void publishCarSeriesVideoCommentRealtimeScheduleTriggerInfo(CrawlerJob crawlerJob){//实时调度触发信息
        HttpPage page = metaServiceCommand_17.addOrUpdateScheduleCrawlerTrigger(//添加调度爬虫触发
                crawlerJob.generateCrawlerKey(),//生成爬虫key
                crawlerJob.generateCrawlerTriggerKey(),//生成爬虫触发key
                SinaCarSeriesArticleCrawlerScheduleJob.domain,//工作的域
                CrawlerMetaConstant.ScheduleJobTrigger_Cron, "0 0 12 * * ?", "新浪车系页视频评论每天12点定时采集");//采集信息-
        System.out.println("添加采集调度： "+page.getRawText());//调度文本
    }

    //车系文章链接
    public static void publishCarSeriesInformationRealtimeScheduleTriggerInfo(CrawlerJob crawlerJob){//实时调度触发信息
        HttpPage page = metaServiceCommand_17.addOrUpdateScheduleCrawlerTrigger(//添加调度爬虫触发
                crawlerJob.generateCrawlerKey(),//生成爬虫key
                crawlerJob.generateCrawlerTriggerKey(),//生成爬虫触发key
                SinaCarSeriesArticleCrawlerScheduleJob.domain,//工作的域
                CrawlerMetaConstant.ScheduleJobTrigger_Cron, "0 0 9 * * ?", "新浪车系页文章链接每天9点定时采集");//采集信息-
        System.out.println("添加采集调度： "+page.getRawText());//调度文本
    }

    //车系文章评论
    public static void publishCarSeriesInformationCommentRealtimeScheduleTriggerInfo(CrawlerJob crawlerJob){//实时调度触发信息
        HttpPage page = metaServiceCommand_17.addOrUpdateScheduleCrawlerTrigger(//添加调度爬虫触发
                crawlerJob.generateCrawlerKey(),//生成爬虫key
                crawlerJob.generateCrawlerTriggerKey(),//生成爬虫触发key
                SinaCarSeriesArticleCrawlerScheduleJob.domain,//工作的域
                CrawlerMetaConstant.ScheduleJobTrigger_Cron, "0 0 12 * * ?", "新浪车系页文章评论每天12点定时采集");//采集信息-
        System.out.println("添加采集调度： "+page.getRawText());//调度文本
    }

    //车系id
    public static void publishCarSeriesScheduleTriggerInfo(CrawlerJob crawlerJob){//实时调度触发信息
        HttpPage page = metaServiceCommand_17.addOrUpdateScheduleCrawlerTrigger(//添加调度爬虫触发
                crawlerJob.generateCrawlerKey(),//生成爬虫key
                crawlerJob.generateCrawlerTriggerKey(),//生成爬虫触发key
                SinaCarSeriesArticleCrawlerScheduleJob.domain,//工作的域
                CrawlerMetaConstant.ScheduleJobTrigger_Cron, "0 0 1 1 * ?", "新浪车系页文章评论每天12点定时采集");//采集信息-
        System.out.println("添加采集调度： "+page.getRawText());//调度文本
    }

}
